package com.zhuoyue.biz.core.api.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhuoyue.biz.core.api.domain.base.BaseDoClass;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 红外设备实体类
 *
 * @author wjming
 */
@Data
@TableName("tbl_infrared_device")
public class InfraredDeviceDO extends BaseDoClass {


    @TableField(value = "`home_id`")
    private String homeId;
    /**
     * 红外学习仪设备id
     */
    @TableField(value = "`device_id`")
    private String deviceId;

    @TableField(value = "`room_id`", fill = FieldFill.UPDATE)
    private String roomId;

    /**
     * 红外设备名称
     */
    @TableField(value = "`name`")
    private String name;

    /**
     * 4：普通空调；5：电视；6：风扇；7：中央空调：71:中央空调升级版本；  8:机顶盒 9nb电表
     */
    @TableField(value = "`type`")
    private Integer type;

    /**
     * 中央空调编号
     */
    @TableField(value = "`central_ac_code`")
    private String centralAcCode;

    @TableField(value = "img_url")
    private String imgUrl;
    /**
     * 小黑豆返回action
     */
    @TableField(exist = false)
    private String actions;
    @TableField(value = "room_name", exist = false)
    private String roomName;
    @TableField(value = "`device_type`")
    private String deviceType;

    @TableField(value = "`prod_id`")
    private String prodId;


    /**
     * 0FAD0702下的中央空桶控制器网关专用
     *
     * @return
     */
    public InfraredDeviceDO saveAirCenter(String deviceId, String homeId, String centralAcCode) {
        this.deviceId = deviceId;
        this.name = "空调";
        this.imgUrl = "http://www.img.zyzncloud.com/zyzn/devices/ir/air.png";
        this.homeId = homeId;
        this.centralAcCode = centralAcCode;
        this.type = 71;
        return this;
    }

}
